import request from '@/utils/request'

// 管理员
export function getAdminUser(params) {
  return request({
    url: 'api/v1/admin/admin/adminUser',
    method: 'get',
    params: params
  })
}

export function createUser(params) {
  return request({
    url: 'api/v1/admin/admin/createUser',
    method: 'post',
    data: params
  })
}

export function editUser(params) {
  return request({
    url: 'api/v1/admin/admin/editUser',
    method: 'post',
    data: params
  })
}

export function userDetail(params) {
  return request({
    url: 'api/v1/admin/admin/userDetail',
    method: 'get',
    params: params
  })
}

export function userDelete(params) {
  return request({
    url: 'api/v1/admin/admin/userDelete',
    method: 'delete',
    params: params
  })
}

// 权限组
export function roleList(params) {
  return request({
    url: 'api/v1/admin/role/roleList',
    method: 'get',
    params: params
  })
}

export function roleCreate(params) {
  return request({
    url: 'api/v1/admin/role/roleCreate',
    method: 'post',
    data: params
  })
}

export function roleEdit(params) {
  return request({
    url: 'api/v1/admin/role/roleEdit',
    method: 'post',
    data: params
  })
}

export function roleDetail(params) {
  return request({
    url: 'api/v1/admin/role/roleDetail',
    method: 'get',
    params: params
  })
}

export function roleDelete(params) {
  return request({
    url: 'api/v1/admin/role/roleDelete',
    method: 'delete',
    params: params
  })
}

export function getMenu(params) {
  return request({
    url: 'api/v1/admin/role/getMenu',
    method: 'get',
    params: params
  })
}

export function getRoles(params) {
  return request({
    url: 'api/v1/admin/role/getRoles',
    method: 'get',
    params: params
  })
}

// 系统菜单
export function menuList(params) {
  return request({
    url: 'api/v1/admin/menu/menuList',
    method: 'get',
    params: params
  })
}

export function addOrEditMenu(params) {
  return request({
    url: 'api/v1/admin/menu/addOrEditMenu',
    method: 'post',
    data: params
  })
}

export function menuDelete(params) {
  return request({
    url: 'api/v1/admin/menu/menuDelete',
    method: 'delete',
    params: params
  })
}
